1. Field of the Invention
The invention relates in general to an audio processing method, and more particularly to an audio regulating method used in network audio playing.
2. Description of the Related Art
When audio is being played in a host having a sound card, a mixing program, such as a core-mixing program of an operating system (KMixer: kernel mixer of Microsoft Windows) is utilized to control the transmission quantity of audio data. After that, a hardware channel interface driver, such as WavePci or WaveCyclic of the miniport driver in Microsoft Windows, receives the audio data transmitted from the mixing program and then outputs the audio data to the sound card for playing the audio. The mixing program provides the quantity of data transmission precisely when the hardware channel interface driver provides the playing position of the audio data. That is, the mixing program can correctly control the transmission quantity per second of the audio data with the data playing position given by the hardware channel interface driver.
However, if audio is broadcasted by way of webcasting, a virtual sound card is utilized to receive the audio data since the host does not have a physical sound card, and the audio data is then transmitted to an audio playing device through the Internet. The hardware channel interface driver can calculate the data quantity of audio data required in a certain period of time according to the time accumulated during this certain period of time. Thus, the mixing program can control the data quantity of audio data transmitted to the hardware channel interface driver for further handling. For example, in a Microsoft operating system, the quantity of data transmission is obtained by using Getposition( ) of the IMiniportWaveCyclicStream or IMiniportWaveCyclicStream interface. In the example of a virtual audio driver, the implementation of Getposition( ) is to get the time difference between the current time and the previous time of calling Getposition( ), in order to get the quantity of audio data transmission. Then, the approximate playing position is calculated according to the format and the transmission rate of the audio data such that the mixing program can refer to and control the quantity of audio data transmission. However, when being used in the network for real time audio playing, the approximate playing position and the error accumulated during multiple calculations will cause unpleasant crackling sounds during real time audio playing.